package com.yike.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yike.user.entity.AgentShopCount;

import com.yike.user.vo.*;
import org.apache.ibatis.annotations.Mapper;

import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;

/**
 * 代理商店铺分佣统计 Mapper 接口
 *
 * @author Sakura
 * @since 2024-11-13
 */
@Mapper
public interface AgentShopCountMapper extends BaseMapper<AgentShopCount> {

    List<AgentCountDataVo> getAgentCountDataVos(@Param("certainDate") String certainDate);

    AgentCountDataVo getAgentCountDataVo(@Param("agentId") Long agentId, @Param("certainDate") String certainDate);

    // 处理订单分润问题，此方法临时用，后续应该放到order服务中
    int updateOrderCommission(@Param("orderId") Long orderId, @Param("platformCommissionRate") BigDecimal platformCommissionRate);

    AgentCommissionVo getAgentCommission(@Param("agentId") Long agentId, @Param("certainDate") String certainDate,
                                         @Param("beginTime") String beginTime, @Param("endTime") String endTime);

    AgentShopCommissionVo getAgentShopCommission(@Param("agentId") Long agentId, @Param("shopId") Long shopId,
                                                 @Param("certainDate") String certainDate,
                                                 @Param("beginTime") String beginTime, @Param("endTime") String endTime);

    List<AgentColumnarDataStatisticsVo> getAgentColumnarDataStatistics(@Param("agentId") Long agentId, @Param("beginTime") String beginTime, @Param("endTime") String endTime);

    List<AgentSearchListVo> getAgentSearchList(@Param("agentId") Long agentId, @Param("beginTime") String beginTime, @Param("endTime") String endTime);

    List<AgentSearchListVo> getShopSearchList(@Param("shopId") Long shopId, @Param("beginTime") String beginTime, @Param("endTime") String endTime);

    Integer getAgentOrderNumber(@Param("agentId") Long agentId,
                                @Param("certainDate") String certainDate,
                                @Param("beginTime") String beginTime, @Param("endTime") String endTime);

    ShopCommissionVo getShopCommission(@Param("shopId") Long shopId,
                                       @Param("certainDate") String certainDate,
                                       @Param("beginTime") String beginTime, @Param("endTime") String endTime);


}
